﻿using BCEntity.TMS.User.UserAddressBook;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace BCData.TMS.User.UserAddressBook
{
    public interface IUserAddressBookData
    {
        /// <summary>
        /// 删除用户地址薄
        /// </summary>
        /// <param name="userAddressBookId">用户地址薄Id</param>
        /// <returns></returns>
        Task<int> DeleteAsync(long userAddressBookId);

        /// <summary>
        /// 获取用户地址薄信息
        /// </summary>
        /// <param name="userAddressBookId">用户地址薄Id</param>
        /// <returns></returns>
        Task<UserAddressBookViewEntity> GetEntityAsync(long userAddressBookId);

        /// <summary>
        /// 添加用户地址薄
        /// </summary>
        /// <param name="entity">用户地址薄信息</param>
        /// <returns></returns>
        
        Task<UserAddressBookEntity> InsertAsync(UserAddressBookEntity entity);

        /// <summary>
        /// 更新用户地址薄
        /// </summary>
        /// <param name="entity">用户地址薄信息</param>
        /// <returns></returns>
        Task<UserAddressBookEntity> UpdateAsync(UserAddressBookEntity entity);

        /// <summary>
        /// 更新此用户其他地址薄记录是否默认为false
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns></returns>
        Task<int> UpdateIsDefault(long userId);

        /// <summary>
        /// 获取用户地址薄
        /// </summary>
        /// <param name="userInfo">用户信息</param>
        /// <param name="pageIndex">页号</param>
        /// <param name="pageSize">每页数据条数</param>
        /// <returns></returns>
        Task<(IEnumerable<UserAddressBookViewEntity>, int)> Query(long userId, int pageIndex, int pageSize);

        /// <summary>
        /// 获取用户地址薄列表
        /// </summary>
        /// <param name="userId">用户ID</param>
        /// <returns></returns>
        Task<IEnumerable<UserAddressBookViewEntity>> GetList(long userId);
    }
}